﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using eCRAM.Model;

namespace eCRAM.WebSite.Models
{
    public class ValidateCramByDateModel
    {
        public int Month { get; set; }
        public int Year { get; set; }
        public IEnumerable<ValidateCramByActivityModel> ActivitiesModel { get; set; }
    }

    public class ValidateCramByActivityModel
    {
        public Activity Activity { get; set; }

        public IEnumerable<ValidateCramByUserModel> UsersModel { get; set; }


        public decimal Total 
        {
            get { return UsersModel.Sum(u => u.Line.Rates.Sum(a => a.Value)); }
        }
    }

    public class ValidateCramByUserModel
    {
        public Guid Id { get; set; }
        public User User { get; set; }
        public CramLineModels Line { get; set; }
    }
}